---
title: Portal
description: A Portal lets you render some children into a different part of the DOM. The Portal component is a simple wrapper around the createPortal that renders everything in the document.body or a div.
docType: Demo
docGroup: Components
group: Utils
components: [Portal]
---

# Portal

A `Portal` lets you render some children into a different part of the DOM. The
`Portal` component is a simple wrapper around the
[createPortal](https://react.dev/reference/react-dom/createPortal) that renders
everything in the `document.body` or a `<div id="rmd-portal-container" />`.

See the [PortalContainerProvider](./portal-container-provider) to see how to change
the portal container on an app level.

> !Warn! This is mostly an internal component for `react-md` and doesn't have
> many use-cases other than rendering all elements into a specific container
> element.

## Simple Example

When the app is wrapped in the `CoreProviders` or `PortalContainerProvider`, all
portalled elements will be rendered within a `<div id="rmd-portal-container" />`
which is usually the last element within the `document.body`.

```demo source="./SimplePortalExample.tsx"

```
